package com.oreilly.android.taskmanager.tasks;

import java.util.Date;

public class Task {
	private long id;
	private String title;
	private String description;
	private boolean complete;
	
	private boolean hasDate;
	private Date dueDate;

	private double latitude;
	private double longitude;

	private String location;

	public Task() {

	}

	public Task(String taskName) {
		this(taskName, "");
	}

	public Task(String text, String description) {
		setTitle(text);
		setDescription(description);
	}

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public String toString() {
		return title + ": " + description;
	}

	public boolean isComplete() {
		return complete;
	}

	public void setComplete(boolean complete) {
		this.complete = complete;
	}

	public void toggleComplete() {
		complete = !complete;
	}

	public long getId() {
		return id;
	}

	public void setId(long id) {
		this.id = id;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public String getDescription() {
		return description;
	}

	public boolean hasLocation() {
		return location != null;
	}

	public double getLatitude() {
		return latitude;
	}

	public void setLatitude(double latitude) {
		this.latitude = latitude;
	}

	public double getLongitude() {
		return longitude;
	}

	public void setLongitude(double longitude) {
		this.longitude = longitude;
	}

	public Date getDueDate() {
		return dueDate;
	}

	public void setDueDate(Date dueDate) {
		this.dueDate = dueDate;
	}

	public void setDueDate(int year, int month, int day) {
		setDueDate(new Date(year, month, day));
	}

	public String getLocation() {
		return location;
	}

	public void setLocation(String location) {
		this.location = location;
	}
}
